<?php 
/*
* ----------------------------------------------------------------------------------------------------
* MENU FUNCTIONS
* @PACKAGE BY TT from THEMECENTER.NET
* ----------------------------------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------
*Top Menu
------------------------------------------------------------------------*/
#
#Add SEO meta
#
function tt_add_seo_meta() 
{
	$enable_seo = get_theme_option('general', 'enable_seo');
	$seo_follow = get_meta_option('seo_follow');
	$seo_noindex = get_meta_option('seo_noindex');
	$seo_keywords = get_meta_option('seo_keywords');
	$seo_description = get_meta_option('seo_description');
	$seo_title_tags = get_meta_option('seo_title_tags');

	if( is_singular() && $enable_seo == 'true' )
	{
		if($seo_follow == true) { $seo_follow = 'follow'; } else { $seo_follow = 'nofollow'; }
		if($seo_noindex == true) { $seo_noindex = 'noindex'; } else { $seo_noindex = 'index'; }

		echo '<meta name="robots" content="'.$seo_noindex.', '.$seo_follow.'" />'."\n";

		if($seo_keywords) 
		{
		echo '<meta name="keywords" content="'.stripslashes($seo_keywords).'" />'."\n";
		}

		if($seo_description)
		{
		echo '<meta name="description" content="'.stripslashes($seo_description).'" />'."\n";
		}
	}

	echo ''."\n";
	echo '<!--Title-->'."\n";
	if( is_singular() && $seo_title_tags != '' && $enable_seo == 'true' ) 
	{
		echo '<title>'.stripslashes($seo_title_tags).'</title>'."\n";
	}
	else
	{
		echo '<title>';
		wp_title('&laquo;', true, 'right');
		echo '</title>'."\n";
	}
}

add_action('wp_seo', 'tt_add_seo_meta');


?>